import {
	getUserInfo
} from '@/api/user.js';
import {
	getRoute
} from '@/utils/tools';
const initState = {
	token: '',
	thirdInfo: {},
	userInfo: {},
	agentIdss: '',
	longitudess: '',
	latitudess: '',
}
export default {
	state: {
		...initState,
		initState() {
			return initState
		}
	},
	mutations: {
		login(state, token) {
			state.token = token;
		},
		agentIdss(state, agentIdss) {
			state.agentIdss = agentIdss;
		},
		longitudess(state, longitudess) {
			state.longitudess = longitudess;
		},
		latitudess(state, latitudess) {
			state.latitudess = latitudess;
		},
		setThirdInfo(state, thirdInfo) {
			state.thirdInfo = thirdInfo
		},
		setUserInfo(state, userInfo) {
			state.userInfo = userInfo;
		}
	},
	actions: {
		async getUserInfo({
			commit
		}) {
			const res = await getUserInfo()
			commit('setUserInfo', res.data)
			console.log('555555', res);
		}
	}
}
